package com.formula.propertyshop.view.common;

import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;

import com.formula.propertyshop.R;
import com.formula.propertyshop.utils.Const;
import com.formula.propertyshop.utils.DeviceInfo;

public class NetWorkErrorActivity extends Activity{
	private Button btnRetry;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.nonetwork_form);
		btnRetry = (Button) findViewById(R.id.btnRetry);
		btnRetry.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				if(DeviceInfo.checkNetworkState(NetWorkErrorActivity.this))
				{
					setResult(RESULT_OK);
					NetWorkErrorActivity.this.finish();
					
				}
			}
		});
	}
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
	    if ((keyCode == KeyEvent.KEYCODE_BACK)) {
	    	setResult(Const.EXIT_KEY);	    	 
	    	 finish();	    	 
	    }
		return super.onKeyDown(keyCode, event);
	}
}
